Click here to return to the VHDL Reference Guide. (last edit: 24. september 2012)

String

A string is a value for a one-dimensional array of characters. A string of '0's and '1's may be written in octal or hexadecimal instead of binary. String is also the name of a type defined in package Standard.

Syntax

  "{any string of printable characters}"
  B"BitValue"                         {binary}
  O"BitValue"                         {octal}
  X"BitValue"                         {hexadecimal}

  BitValue = {hex digits 0-9, A-F and underscores}
    

Where

See Expression

Things to remember

A value of type Std_logic_vector may be written as a string with an explicit number base in VHDL'93, but must be written without a number base in VHDL'87. Underscores are only ignored if the string has an explicit number base. Other values such as 'X' or 'Z' are not allowed if the string has an explicit number base. Strings are case sensitive, e.g. "xxxx" is not the same as "XXXX".

Example

  "Hello"
  "0000XXXX"
  B"0000_0101"
  X"FFFF"
    

See Also

Number, Enumeration, Standard